package com.doit.demo02;

public class test04 {
    public static void main(String[] args) {
        Integer i1 = 500;//自动装箱,所以地址不同.写全就是:new Integer();
        Integer i2 = 500;
        System.out.println(i1==i2);//比较的是地址
        System.out.println(i1.equals(i2));//比较的是内容

        Integer i3 = new Integer(500);
        Integer i4 = new Integer(500);
        System.out.println(i3==i4);
        System.out.println(i3.equals(i4));

        System.out.println();

        //在byte范围内,-127-128
        Integer i5 = 50;
        Integer i6 = 50;//i6=i5
        System.out.println(i5==i6);//比较的是地址
        System.out.println(i5.equals(i6));//比较的是内容

        Integer i7 = new Integer(50);
        Integer i8 = new Integer(50);
        System.out.println(i7==i8);
        System.out.println(i7.equals(i8));

    }
}
